import request from '@/utils/request'

// 查询题库列表
export function listQuestionBank(query) {
  return request({
    url: '/question/questionBank/list',
    method: 'get',
    params: query
  })
}

// 查询题库详细
export function getQuestionBank(qbId) {
  return request({
    url: '/question/questionBank/' + qbId,
    method: 'get'
  })
}

// 新增题库
export function addQuestionBank(data) {
  return request({
    url: '/question/questionBank',
    method: 'post',
    data: data
  })
}

// 修改题库
export function updateQuestionBank(data) {
  return request({
    url: '/question/questionBank',
    method: 'put',
    data: data
  })
}

// 删除题库
export function delQuestionBank(qbId) {
  return request({
    url: '/question/questionBank/' + qbId,
    method: 'delete'
  })
}

// 查询题库已绑定题目列表
export function qbBindQuList(query) {
  return request({
    url: '/question/questionBank/list/qu/bind',
    method: 'get',
    params: query
  })
}

// 查询题库未绑定题目列表
export function qbUnBindQuList(query) {
  return request({
    url: '/question/questionBank/list/qu/unBind',
    method: 'get',
    params: query
  })
}


// 批量解绑题库题目
export function removeQu(data) {
  return request({
    url: '/question/questionBank/qu',
    method: 'delete',
    data: data
  })
}

// 批量绑定题库题目
export function addQu(data) {
  return request({
    url: '/question/questionBank/qu',
    method: 'post',
    data: data
  })
}


// 查询题库用户列表
export function bindQbUserList(qbUser) {
  return request({
    url: '/question/questionBank/list/user/bind',
    method: 'get',
    params: qbUser
  })
}

// 查询题库未绑定用户列表
export function unBindQbUserList(qbUser) {
  return request({
    url: '/question/questionBank/list/user/unBind',
    method: 'get',
    params: qbUser
  })
}

// 解绑题库用户
export function removeUser(qbUsers) {
  return request({
    url: '/question/questionBank/user',
    method: 'delete',
    data: qbUsers
  })
}

// 绑定题库用户
export function addUser(qbUsers) {
  return request({
    url: '/question/questionBank/user',
    method: 'post',
    data: qbUsers
  })
}


